<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ page contentType="text/html; charset=UTF-8"%>
<html>
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
	<link type="text/css" rel="stylesheet" href="/static/css/style.css" />
	<script type="text/javascript" src="../../static/js/jquery-1.8.3.min.js"></script>
	<script type="text/javascript">

            alert($(":input[name=upFile]").)


	</script>
</head>
<body>
<%--
    action
    method
    name
--%>
<form id="myForm" action="editProductById.do" method="post" enctype="multipart/form-data" style="margin: 1px;">
	<%--开发规范，所有隐藏域放在表单的最开始，方便管理--%>
	<input type="hidden" name="id" value="${product.id}" />


	<table cellSpacing="1" cellPadding="5" width="100%" align="center" bgColor="#eeeeee" style="border: 1px solid #8ba7e3" border="0">
		<tr>
			<td class="ta_01" bgColor="#afd1f3" colSpan="4" height="26">
				<strong>添加商品</strong>
			</td>
		</tr>
		<tr>
			<td width="20%" align="center" bgColor="#f5fafe" class="ta_01">
				商品名称：
			</td>
			<td width="30%" class="ta_01" bgColor="#ffffff">
				<input type="text" name="name" value="${product.name}" id="userAction_save_do_logonName" class="bg"/>
			</td>
			<td width="20%" align="center" bgColor="#f5fafe" class="ta_01">
				所属分类：
			</td>
			<td class="ta_01" bgColor="#ffffff">
				<select name="tid" class="bg">
					<c:forEach items="${types}" var="t">
						<option value="${t.id}" ${t.id == product.tid ? "selected" : ""}>${t.name}</option>
					</c:forEach>
				</select>
			</td>
		</tr>
		<tr>
			<td align="center" bgColor="#f5fafe" class="ta_01">
				商品价格：
			</td>
			<td class="ta_01" bgColor="#ffffff">
				<input type="text" name="price" value="${product.price}" class="bg"/>
			</td>
			<td align="center" bgColor="#f5fafe" class="ta_01">
				库存数量：
			</td>
			<td class="ta_01" bgColor="#ffffff">
				<input type="text" name="num" class="bg" value="${product.num}" />
			</td>
		</tr>
		<%--<tr>
            <td align="center" bgColor="#f5fafe" class="ta_01">
                商品图片：
            </td>
            <td class="ta_01" bgColor="#ffffff" colspan="3">

                <input type="file" name="upFile" class="bg" />
            </td>
        </tr>--%>
		<tr>
			<td align="center" bgColor="#f5fafe" class="ta_01">
				商品描述：
			</td>
			<td class="ta_01" bgColor="#ffffff" colspan="3">
				<textarea name="description" rows="5" style="width:100%;">${product.description}</textarea>
			</td>
		</tr>
		<tr>
			<td class="ta_01" style="WIDTH: 100%" align="center" bgColor="#f5fafe" colSpan="4">
				<input type="button"  value="确定" id="btn" />&nbsp;&nbsp;
				<input type="reset" value="重置" />&nbsp;&nbsp;
				<input id="goBack" type="button" value="返回" onclick="history.go(-1)" />
			</td>
		</tr>
	</table>
</form>
</body>
</html>